// Copyright 2008 Senary
// See credits.txt for details.

// This file is part of Omega VII.

// Omega VII is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Omega VII is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Omega VII.  If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include <windows.h>
#include <map>
#include <string>

#include "sdk_engine/adll.h"

/*
 Singleton class.
*/
class MediaManager
{
private:
	// Singleton Instance
	static MediaManager* _pInstance;

	// Stores pointers to all loaded images, and the corresponding file names.
	std::map<std::string, BMAP*> _imageMap;	

	// Stores pointers to all loaded sounds, and the corresponding file names.
	std::map<std::string, SOUND*> _soundMap;	

	// Singleton: private constructor
	MediaManager(void);

public:
	~MediaManager(void);

	//singleton method
	static MediaManager* getInstance(void);

	// returns an BMAP* corresponding to the given file name
	// loads the image if necessary
	BMAP* getImage(const std::string& imageName);

	// returns a SOUND* corresponding to the given file name
	// loads the sound if necessary
	SOUND* getSound(const std::string& soundName);

};
